with Ada.Text_IO ; use Ada.Text_Io;
with Ada.Integer_Text_Io ; use Ada.Integer_Text_Io;

procedure Jour_Date is
   type Week  is (Sunday, Monday, Tuesday, Wenesday, Thursday, Friday, Saturday);
   type Jour is range 1..31;
   type Month is range 1..12;
   type Année is Positive ;

   function Validate(Year : Integer  ; M: Integer ; D : Integer) return Boolean is
      -- var locale
      B :Boolean := False;
   begin

      if Year rem 400 = 0 then
         -- b
         B := True ;
      else if Year rem 4 = 0 and not (Year rem 100 = 0) then
         -- b
         B := True ;
      else
         B := False ;
      end if;
      end if;

      if B = True then -- bissextile
         if M = 1 or M=3 or M=5 or M=7 or M=8 or M=10 or M=12 then --31d
            if D>0 and D<=31 then
               return True;
            else
               return False;
            end if;
         else if M= 4 or M= 6 or M=9 or M= 11 then --30d
            if D>0 and D<=30 then
               return True;
            else
               return False;
            end if;
         else --february
            if D>0 and D<=29 then
               return True;
            else
               return False;
            end if;
         end if;
         end if;
      Else  -- ! bissextile
         if M = 1 or M=3 or M=5 or M=7 or M=8 or M=10 or M=12 then --31d
            if D>0 and D<=31 then
               return True;
            else
               return False;
            end if;
         else if  M= 4 or M= 6 or M=9 or M= 11 then --30 d
            if D>0 and D<=30 then
               return True;
            else
               return False;
            end if;
         else --february
            if D>0 and D<=28 then
               return True;
            else
               return False;
            end if;
         end if;
         end if;
      end if;
   end Validate;


   Jj : Jour ;
   Mm : Month ;
   Aa: Année ;

   -- reference

   J0 : constant Jour  := 01   ;
   M0 : constant Month := 01   ;
   A0 : constant Année := 1995 ;


begin
   Put("day : ?");
   Get(Jj);
   Put("month : ?");
   Get(Mm);
   Put("year : ?");
   Get(Aa);
end Jour_Date;
);
   Put(
